3.224 \(\int \frac{\tan ^5(e+f x)}{(a+b \tan ^2(e+f x))^2} \, dx\)

Optimal. Leaf size=90 \[ \frac{a^2}{2 b^2 f (a-b) \left (a+b \tan ^2(e+f x)\right )}+\frac{a (a-2 b) \log \left (a+b \tan ^2(e+f x)\right )}{2 b^2 f (a-b)^2}-\frac{\log (\cos (e+f x))}{f (a-b)^2} \]

[Out]

-(Log[Cos[e + f*x]]/((a - b)^2*f)) + (a*(a - 2*b)*Log[a + b*Tan[e + f*x]^2])/(2*(a - b)^2*b^2*f) + a^2/(2*(a -
 b)*b^2*f*(a + b*Tan[e + f*x]^2))

________________________________________________________________________________________

Rubi [A]  time = 0.121305, antiderivative size = 90, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 3, integrand size = 23, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.13, Rules used = {3670, 446, 88} \[ \frac{a^2}{2 b^2 f (a-b) \left (a+b \tan ^2(e+f x)\right )}+\frac{a (a-2 b) \log \left (a+b \tan ^2(e+f x)\right )}{2 b^2 f (a-b)^2}-\frac{\log (\cos (e+f x))}{f (a-b)^2} \]

Antiderivative was successfully verified.

[In]

Int[Tan[e + f*x]^5/(a + b*Tan[e + f*x]^2)^2,x]

[Out]

-(Log[Cos[e + f*x]]/((a - b)^2*f)) + (a*(a - 2*b)*Log[a + b*Tan[e + f*x]^2])/(2*(a - b)^2*b^2*f) + a^2/(2*(a -
 b)*b^2*f*(a + b*Tan[e + f*x]^2))

Rule 3670

Int[((d_.)*tan[(e_.) + (f_.)*(x_)])^(m_.)*((a_) + (b_.)*((c_.)*tan[(e_.) + (f_.)*(x_)])^(n_))^(p_.), x_Symbol]
 :> With[{ff = FreeFactors[Tan[e + f*x], x]}, Dist[(c*ff)/f, Subst[Int[(((d*ff*x)/c)^m*(a + b*(ff*x)^n)^p)/(c^
2 + ff^2*x^2), x], x, (c*Tan[e + f*x])/ff], x]] /; FreeQ[{a, b, c, d, e, f, m, n, p}, x] && (IGtQ[p, 0] || EqQ
[n, 2] || EqQ[n, 4] || (IntegerQ[p] && RationalQ[n]))

Rule 446

Int[(x_)^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_.)*((c_) + (d_.)*(x_)^(n_))^(q_.), x_Symbol] :> Dist[1/n, Subst[Int
[x^(Simplify[(m + 1)/n] - 1)*(a + b*x)^p*(c + d*x)^q, x], x, x^n], x] /; FreeQ[{a, b, c, d, m, n, p, q}, x] &&
 NeQ[b*c - a*d, 0] && IntegerQ[Simplify[(m + 1)/n]]

Rule 88

Int[((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.)*((e_.) + (f_.)*(x_))^(p_.), x_Symbol] :> Int[ExpandI
ntegrand[(a + b*x)^m*(c + d*x)^n*(e + f*x)^p, x], x] /; FreeQ[{a, b, c, d, e, f, p}, x] && IntegersQ[m, n] &&
(IntegerQ[p] || (GtQ[m, 0] && GeQ[n, -1]))

Rubi steps

\begin{align*} \int \frac{\tan ^5(e+f x)}{\left (a+b \tan ^2(e+f x)\right )^2} \, dx &=\frac{\operatorname{Subst}\left (\int \frac{x^5}{\left (1+x^2\right ) \left (a+b x^2\right )^2} \, dx,x,\tan (e+f x)\right )}{f}\\ &=\frac{\operatorname{Subst}\left (\int \frac{x^2}{(1+x) (a+b x)^2} \, dx,x,\tan ^2(e+f x)\right )}{2 f}\\ &=\frac{\operatorname{Subst}\left (\int \left (\frac{1}{(a-b)^2 (1+x)}-\frac{a^2}{(a-b) b (a+b x)^2}+\frac{a (a-2 b)}{(a-b)^2 b (a+b x)}\right ) \, dx,x,\tan ^2(e+f x)\right )}{2 f}\\ &=-\frac{\log (\cos (e+f x))}{(a-b)^2 f}+\frac{a (a-2 b) \log \left (a+b \tan ^2(e+f x)\right )}{2 (a-b)^2 b^2 f}+\frac{a^2}{2 (a-b) b^2 f \left (a+b \tan ^2(e+f x)\right )}\\ \end{align*}

Mathematica [A]  time = 0.665275, size = 73, normalized size = 0.81 \[ \frac{\frac{a^2 (a-b)}{b^2 \left (a+b \tan ^2(e+f x)\right )}+\frac{a (a-2 b) \log \left (a+b \tan ^2(e+f x)\right )}{b^2}-2 \log (\cos (e+f x))}{2 f (a-b)^2} \]

Antiderivative was successfully verified.

[In]

Integrate[Tan[e + f*x]^5/(a + b*Tan[e + f*x]^2)^2,x]

[Out]

(-2*Log[Cos[e + f*x]] + (a*(a - 2*b)*Log[a + b*Tan[e + f*x]^2])/b^2 + (a^2*(a - b))/(b^2*(a + b*Tan[e + f*x]^2
)))/(2*(a - b)^2*f)

________________________________________________________________________________________

Maple [A]  time = 0.026, size = 149, normalized size = 1.7 \begin{align*}{\frac{{a}^{2}\ln \left ( a+b \left ( \tan \left ( fx+e \right ) \right ) ^{2} \right ) }{2\,f \left ( a-b \right ) ^{2}{b}^{2}}}-{\frac{a\ln \left ( a+b \left ( \tan \left ( fx+e \right ) \right ) ^{2} \right ) }{f \left ( a-b \right ) ^{2}b}}+{\frac{{a}^{3}}{2\,f \left ( a-b \right ) ^{2}{b}^{2} \left ( a+b \left ( \tan \left ( fx+e \right ) \right ) ^{2} \right ) }}-{\frac{{a}^{2}}{2\,f \left ( a-b \right ) ^{2}b \left ( a+b \left ( \tan \left ( fx+e \right ) \right ) ^{2} \right ) }}+{\frac{\ln \left ( 1+ \left ( \tan \left ( fx+e \right ) \right ) ^{2} \right ) }{2\,f \left ( a-b \right ) ^{2}}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(tan(f*x+e)^5/(a+b*tan(f*x+e)^2)^2,x)

[Out]

1/2/f*a^2/(a-b)^2/b^2*ln(a+b*tan(f*x+e)^2)-1/f*a/(a-b)^2/b*ln(a+b*tan(f*x+e)^2)+1/2/f*a^3/(a-b)^2/b^2/(a+b*tan
(f*x+e)^2)-1/2/f*a^2/(a-b)^2/b/(a+b*tan(f*x+e)^2)+1/2/f/(a-b)^2*ln(1+tan(f*x+e)^2)

________________________________________________________________________________________

Maxima [A]  time = 1.14079, size = 173, normalized size = 1.92 \begin{align*} -\frac{\frac{a^{2}}{a^{3} b - 2 \, a^{2} b^{2} + a b^{3} -{\left (a^{3} b - 3 \, a^{2} b^{2} + 3 \, a b^{3} - b^{4}\right )} \sin \left (f x + e\right )^{2}} - \frac{{\left (a^{2} - 2 \, a b\right )} \log \left (-{\left (a - b\right )} \sin \left (f x + e\right )^{2} + a\right )}{a^{2} b^{2} - 2 \, a b^{3} + b^{4}} + \frac{\log \left (\sin \left (f x + e\right )^{2} - 1\right )}{b^{2}}}{2 \, f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(f*x+e)^5/(a+b*tan(f*x+e)^2)^2,x, algorithm="maxima")

[Out]

-1/2*(a^2/(a^3*b - 2*a^2*b^2 + a*b^3 - (a^3*b - 3*a^2*b^2 + 3*a*b^3 - b^4)*sin(f*x + e)^2) - (a^2 - 2*a*b)*log
(-(a - b)*sin(f*x + e)^2 + a)/(a^2*b^2 - 2*a*b^3 + b^4) + log(sin(f*x + e)^2 - 1)/b^2)/f

________________________________________________________________________________________

Fricas [B]  time = 1.26814, size = 423, normalized size = 4.7 \begin{align*} -\frac{a^{2} b \tan \left (f x + e\right )^{2} + a^{2} b -{\left (a^{3} - 2 \, a^{2} b +{\left (a^{2} b - 2 \, a b^{2}\right )} \tan \left (f x + e\right )^{2}\right )} \log \left (\frac{b \tan \left (f x + e\right )^{2} + a}{\tan \left (f x + e\right )^{2} + 1}\right ) +{\left (a^{3} - 2 \, a^{2} b + a b^{2} +{\left (a^{2} b - 2 \, a b^{2} + b^{3}\right )} \tan \left (f x + e\right )^{2}\right )} \log \left (\frac{1}{\tan \left (f x + e\right )^{2} + 1}\right )}{2 \,{\left ({\left (a^{2} b^{3} - 2 \, a b^{4} + b^{5}\right )} f \tan \left (f x + e\right )^{2} +{\left (a^{3} b^{2} - 2 \, a^{2} b^{3} + a b^{4}\right )} f\right )}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(f*x+e)^5/(a+b*tan(f*x+e)^2)^2,x, algorithm="fricas")

[Out]

-1/2*(a^2*b*tan(f*x + e)^2 + a^2*b - (a^3 - 2*a^2*b + (a^2*b - 2*a*b^2)*tan(f*x + e)^2)*log((b*tan(f*x + e)^2
+ a)/(tan(f*x + e)^2 + 1)) + (a^3 - 2*a^2*b + a*b^2 + (a^2*b - 2*a*b^2 + b^3)*tan(f*x + e)^2)*log(1/(tan(f*x +
 e)^2 + 1)))/((a^2*b^3 - 2*a*b^4 + b^5)*f*tan(f*x + e)^2 + (a^3*b^2 - 2*a^2*b^3 + a*b^4)*f)

________________________________________________________________________________________

Sympy [A]  time = 118.299, size = 1583, normalized size = 17.59 \begin{align*} \text{result too large to display} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(f*x+e)**5/(a+b*tan(f*x+e)**2)**2,x)

[Out]

Piecewise((zoo*x*tan(e), Eq(a, 0) & Eq(b, 0) & Eq(f, 0)), (2*log(tan(e + f*x)**2 + 1)*tan(e + f*x)**4/(4*b**2*
f*tan(e + f*x)**4 + 8*b**2*f*tan(e + f*x)**2 + 4*b**2*f) + 4*log(tan(e + f*x)**2 + 1)*tan(e + f*x)**2/(4*b**2*
f*tan(e + f*x)**4 + 8*b**2*f*tan(e + f*x)**2 + 4*b**2*f) + 2*log(tan(e + f*x)**2 + 1)/(4*b**2*f*tan(e + f*x)**
4 + 8*b**2*f*tan(e + f*x)**2 + 4*b**2*f) + 4*tan(e + f*x)**2/(4*b**2*f*tan(e + f*x)**4 + 8*b**2*f*tan(e + f*x)
**2 + 4*b**2*f) + 3/(4*b**2*f*tan(e + f*x)**4 + 8*b**2*f*tan(e + f*x)**2 + 4*b**2*f), Eq(a, b)), ((log(tan(e +
 f*x)**2 + 1)/(2*f) + tan(e + f*x)**4/(4*f) - tan(e + f*x)**2/(2*f))/a**2, Eq(b, 0)), (x*tan(e)**5/(a + b*tan(
e)**2)**2, Eq(f, 0)), (a**3*log(-I*sqrt(a)*sqrt(1/b) + tan(e + f*x))/(2*a**3*b**2*f + 2*a**2*b**3*f*tan(e + f*
x)**2 - 4*a**2*b**3*f - 4*a*b**4*f*tan(e + f*x)**2 + 2*a*b**4*f + 2*b**5*f*tan(e + f*x)**2) + a**3*log(I*sqrt(
a)*sqrt(1/b) + tan(e + f*x))/(2*a**3*b**2*f + 2*a**2*b**3*f*tan(e + f*x)**2 - 4*a**2*b**3*f - 4*a*b**4*f*tan(e
 + f*x)**2 + 2*a*b**4*f + 2*b**5*f*tan(e + f*x)**2) + a**3/(2*a**3*b**2*f + 2*a**2*b**3*f*tan(e + f*x)**2 - 4*
a**2*b**3*f - 4*a*b**4*f*tan(e + f*x)**2 + 2*a*b**4*f + 2*b**5*f*tan(e + f*x)**2) + a**2*b*log(-I*sqrt(a)*sqrt
(1/b) + tan(e + f*x))*tan(e + f*x)**2/(2*a**3*b**2*f + 2*a**2*b**3*f*tan(e + f*x)**2 - 4*a**2*b**3*f - 4*a*b**
4*f*tan(e + f*x)**2 + 2*a*b**4*f + 2*b**5*f*tan(e + f*x)**2) - 2*a**2*b*log(-I*sqrt(a)*sqrt(1/b) + tan(e + f*x
))/(2*a**3*b**2*f + 2*a**2*b**3*f*tan(e + f*x)**2 - 4*a**2*b**3*f - 4*a*b**4*f*tan(e + f*x)**2 + 2*a*b**4*f +
2*b**5*f*tan(e + f*x)**2) + a**2*b*log(I*sqrt(a)*sqrt(1/b) + tan(e + f*x))*tan(e + f*x)**2/(2*a**3*b**2*f + 2*
a**2*b**3*f*tan(e + f*x)**2 - 4*a**2*b**3*f - 4*a*b**4*f*tan(e + f*x)**2 + 2*a*b**4*f + 2*b**5*f*tan(e + f*x)*
*2) - 2*a**2*b*log(I*sqrt(a)*sqrt(1/b) + tan(e + f*x))/(2*a**3*b**2*f + 2*a**2*b**3*f*tan(e + f*x)**2 - 4*a**2
*b**3*f - 4*a*b**4*f*tan(e + f*x)**2 + 2*a*b**4*f + 2*b**5*f*tan(e + f*x)**2) - a**2*b/(2*a**3*b**2*f + 2*a**2
*b**3*f*tan(e + f*x)**2 - 4*a**2*b**3*f - 4*a*b**4*f*tan(e + f*x)**2 + 2*a*b**4*f + 2*b**5*f*tan(e + f*x)**2)
- 2*a*b**2*log(-I*sqrt(a)*sqrt(1/b) + tan(e + f*x))*tan(e + f*x)**2/(2*a**3*b**2*f + 2*a**2*b**3*f*tan(e + f*x
)**2 - 4*a**2*b**3*f - 4*a*b**4*f*tan(e + f*x)**2 + 2*a*b**4*f + 2*b**5*f*tan(e + f*x)**2) - 2*a*b**2*log(I*sq
rt(a)*sqrt(1/b) + tan(e + f*x))*tan(e + f*x)**2/(2*a**3*b**2*f + 2*a**2*b**3*f*tan(e + f*x)**2 - 4*a**2*b**3*f
 - 4*a*b**4*f*tan(e + f*x)**2 + 2*a*b**4*f + 2*b**5*f*tan(e + f*x)**2) + a*b**2*log(tan(e + f*x)**2 + 1)/(2*a*
*3*b**2*f + 2*a**2*b**3*f*tan(e + f*x)**2 - 4*a**2*b**3*f - 4*a*b**4*f*tan(e + f*x)**2 + 2*a*b**4*f + 2*b**5*f
*tan(e + f*x)**2) + b**3*log(tan(e + f*x)**2 + 1)*tan(e + f*x)**2/(2*a**3*b**2*f + 2*a**2*b**3*f*tan(e + f*x)*
*2 - 4*a**2*b**3*f - 4*a*b**4*f*tan(e + f*x)**2 + 2*a*b**4*f + 2*b**5*f*tan(e + f*x)**2), True))

________________________________________________________________________________________

Giac [B]  time = 2.97375, size = 536, normalized size = 5.96 \begin{align*} \frac{\frac{{\left (a^{3} - 2 \, a^{2} b\right )} \log \left ({\left | -a{\left (\frac{\cos \left (f x + e\right ) + 1}{\cos \left (f x + e\right ) - 1} + \frac{\cos \left (f x + e\right ) - 1}{\cos \left (f x + e\right ) + 1}\right )} - 2 \, a + 4 \, b \right |}\right )}{a^{3} b^{2} - 2 \, a^{2} b^{3} + a b^{4}} + \frac{\log \left (-\frac{\cos \left (f x + e\right ) + 1}{\cos \left (f x + e\right ) - 1} - \frac{\cos \left (f x + e\right ) - 1}{\cos \left (f x + e\right ) + 1} + 2\right )}{a^{2} - 2 \, a b + b^{2}} - \frac{a^{3}{\left (\frac{\cos \left (f x + e\right ) + 1}{\cos \left (f x + e\right ) - 1} + \frac{\cos \left (f x + e\right ) - 1}{\cos \left (f x + e\right ) + 1}\right )} - 2 \, a^{2} b{\left (\frac{\cos \left (f x + e\right ) + 1}{\cos \left (f x + e\right ) - 1} + \frac{\cos \left (f x + e\right ) - 1}{\cos \left (f x + e\right ) + 1}\right )} + 2 \, a^{3} - 12 \, a^{2} b + 12 \, a b^{2}}{{\left (a^{2} b^{2} - 2 \, a b^{3} + b^{4}\right )}{\left (a{\left (\frac{\cos \left (f x + e\right ) + 1}{\cos \left (f x + e\right ) - 1} + \frac{\cos \left (f x + e\right ) - 1}{\cos \left (f x + e\right ) + 1}\right )} + 2 \, a - 4 \, b\right )}} - \frac{\log \left (-\frac{\cos \left (f x + e\right ) + 1}{\cos \left (f x + e\right ) - 1} - \frac{\cos \left (f x + e\right ) - 1}{\cos \left (f x + e\right ) + 1} - 2\right )}{b^{2}}}{2 \, f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(f*x+e)^5/(a+b*tan(f*x+e)^2)^2,x, algorithm="giac")

[Out]

1/2*((a^3 - 2*a^2*b)*log(abs(-a*((cos(f*x + e) + 1)/(cos(f*x + e) - 1) + (cos(f*x + e) - 1)/(cos(f*x + e) + 1)
) - 2*a + 4*b))/(a^3*b^2 - 2*a^2*b^3 + a*b^4) + log(-(cos(f*x + e) + 1)/(cos(f*x + e) - 1) - (cos(f*x + e) - 1
)/(cos(f*x + e) + 1) + 2)/(a^2 - 2*a*b + b^2) - (a^3*((cos(f*x + e) + 1)/(cos(f*x + e) - 1) + (cos(f*x + e) -
1)/(cos(f*x + e) + 1)) - 2*a^2*b*((cos(f*x + e) + 1)/(cos(f*x + e) - 1) + (cos(f*x + e) - 1)/(cos(f*x + e) + 1
)) + 2*a^3 - 12*a^2*b + 12*a*b^2)/((a^2*b^2 - 2*a*b^3 + b^4)*(a*((cos(f*x + e) + 1)/(cos(f*x + e) - 1) + (cos(
f*x + e) - 1)/(cos(f*x + e) + 1)) + 2*a - 4*b)) - log(-(cos(f*x + e) + 1)/(cos(f*x + e) - 1) - (cos(f*x + e) -
 1)/(cos(f*x + e) + 1) - 2)/b^2)/f